home *** CD-ROM | disk | FTP | other *** search
/ PD Collection CD 1 / PD Collection CD 1.iso / textual / pdftops / xpdf / h / OutputDev < prev    next >
Text File  |  1996-06-08  |  3KB  |  98 lines

  1. //========================================================================
  2. //
  3. // OutputDev.h
  4. //
  5. // Copyright 1996 Derek B. Noonburg
  6. //
  7. //========================================================================
  8.  
  9. #ifndef OUTPUTDEV_H
  10. #define OUTPUTDEV_H
  11.  
  12. #ifdef __GNUC__
  13. //#pragma interface
  14. #endif
  15.  
  16. #include "gtypes.h"
  17.  
  18. class GfxState;
  19. class GfxColorSpace;
  20. class Stream;
  21.  
  22. //------------------------------------------------------------------------
  23. // OutputDev
  24. //------------------------------------------------------------------------
  25.  
  26. class OutputDev {
  27. public:
  28.  
  29.   // Constructor.
  30.   OutputDev() {}
  31.  
  32.   // Destructor.
  33.   virtual ~OutputDev() {}
  34.  
  35.   // Does this device use upside-down coordinates?
  36.   // (Upside-down means (0,0) is the top left corner of the page.)
  37.   virtual GBool upsideDown() { return gFalse; }
  38.  
  39.   // Set page size (in pixels).
  40.   virtual void setPageSize(int x, int y) {}
  41.  
  42.   // Set transform matrix.
  43.   virtual void setCTM(double *ctm1);
  44.  
  45.   // Reset state and clear display, to prepare for a new page.
  46.   virtual void clear() {}
  47.  
  48.   // Dump page contents to display.
  49.   virtual void dump() {}
  50.  
  51.   // Convert between device and user coordinates.
  52.   virtual void cvtDevToUser(int dx, int dy, double *ux, double *uy);
  53.   virtual void cvtUserToDev(double ux, double uy, int *dx, int *dy);
  54.  
  55.   //----- save/restore graphics state
  56.   virtual void saveState(GfxState *state) {}
  57.   virtual void restoreState(GfxState *state) {}
  58.  
  59.   //----- update graphics state
  60.   virtual void updateAll(GfxState *state) {}
  61.   virtual void updateCTM(GfxState *state) {}
  62.   virtual void updateLineDash(GfxState *state) {}
  63.   virtual void updateFlatness(GfxState *state) {}
  64.   virtual void updateLineJoin(GfxState *state) {}
  65.   virtual void updateLineCap(GfxState *state) {}
  66.   virtual void updateMiterLimit(GfxState *state) {}
  67.   virtual void updateLineWidth(GfxState *state) {}
  68.   virtual void updateFillColor(GfxState *state) {}
  69.   virtual void updateStrokeColor(GfxState *state) {}
  70.   virtual void updateFont(GfxState *state) {}
  71.  
  72.   //----- path painting
  73.   virtual void stroke(GfxState *state) = 0;
  74.   virtual void fill(GfxState *state) = 0;
  75.   virtual void eoFill(GfxState *state) = 0;
  76.  
  77.   //----- path clipping
  78.   virtual void clip(GfxState *state) {}
  79.   virtual void eoClip(GfxState *state) {}
  80.  
  81.   //----- text drawing
  82.   virtual void drawChar(GfxState *state, double x, double y,
  83.             Guchar c) = 0;
  84.  
  85.   //----- image drawing
  86.   virtual void drawImageMask(GfxState *state, Stream *str,
  87.                  int width, int height, GBool invert) = 0;
  88.   virtual void drawImage(GfxState *state, Stream *str, int width,
  89.              int height, GfxColorSpace *colorSpace) = 0;
  90.  
  91. private:
  92.  
  93.   double ctm[6];        // coordinate transform matrix
  94.   double ictm[6];        // inverse CTM
  95. };
  96.  
  97. #endif
  98.